/**
 * @Title: AnnounServiceImpl.java
 * @Package com.zll.ccp.service.impl
 * @author zhanglinlu
 * @date 2019年5月18日 下午5:21:56
 */
package com.zll.ccp.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zll.ccp.mapper.IAnnounceMapper;
import com.zll.ccp.model.Announce;
import com.zll.ccp.service.IAnnounceService;

/**
 * @ClassName: AnnounServiceImpl
 * @Description: 实现类
 * @author zhanglinlu
 * @date 2019年5月18日 下午5:21:56
 * 
 */
@Service
@Transactional
public class AnnounServiceImpl implements IAnnounceService {
    @Autowired
    private IAnnounceMapper announceMapper;

    /* (non-Javadoc)
     * @param id
     * @return
     * @see com.zll.ccp.mapper.IAnnounceMapper#getAnnounceById(java.lang.String)
     */
    @Override
    public Announce getAnnounceById(String id) {
        Announce announce = announceMapper.getAnnounceById(id);
        if (null == announce) {
            announce = new Announce();
        }
        return announce;
    }

    /* (non-Javadoc)
     * @param announce
     * @see com.zll.ccp.service.IAnnounceService#addAnnounce(com.zll.ccp.model.Announce)
     */
    @Override
    public void addAnnounce(Announce announce) {
        announceMapper.addAnnounce(announce);
    }

    /* (non-Javadoc)
     * @param announce
     * @see com.zll.ccp.service.IAnnounceService#updateAnnounce(com.zll.ccp.model.Announce)
     */
    @Override
    public void updateAnnounce(Announce announce) {
        announceMapper.updateAnnounce(announce);
    }

    /* (non-Javadoc)
     * @param pTitle
     * @param pCT
     * @return
     * @see com.zll.ccp.service.IAnnounceService#getAnnouncesByFilter(java.lang.String, java.lang.String)
     */
    @Override
    public List<Map<String, Object>> getAnnouncesByFilter(String pTitle, String pCT) {
        return announceMapper.getAnnouncesByFilter(pTitle, pCT);
    }

    /* (non-Javadoc)
     * @param id
     * @see com.zll.ccp.service.IAnnounceService#deleteAnnounce(java.lang.String)
     */
    @Override
    public void deleteAnnounce(String id) {
        announceMapper.deleteAnnounce(id);
    }

}
